package com.yc.txx.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.sql.Timestamp;
import java.time.LocalDateTime;

/**
 * <p>
 * 天下行租车-用户表-4
 * </p>
 *
 * @author xl
 * @since 2024-05-07
 */
@TableName("txx_user")
@Data
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

      /**
     * 编号
     */
        @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      /**
     * 英文名: 账号
     */
      @NotEmpty(message = "账号不能为空")
      @Length(min = 2, max = 20, message = "账号长度必须是2~20字符")
      private String ename;

      /**
     * 中文名: 昵称
     */
      @Length(min = 3, max = 30, message = "昵称长度必须是3~30字符")
      private String cname;

      /**
     * 密码
     */
      @NotEmpty
      @Length(min = 6, max = 16, message = "密码长度必须是2~20字符")
      private String password;

      /**
     * 邮箱
     */
      @NotEmpty
      @Email
      private String eamil;

      /**
     * 头像图片
     */
      @Pattern(regexp = ".+\\.(jpg|png|gif|webp)",
              message = "图片格式不正确")
      private String headimg;

      /**
     * 注册时间
     */
      private Timestamp createtime;

}
